import sqlite3
conn = sqlite3.connect("data/test.db")
c = conn.cursor()
create_sql = 'CREATE TABLE stocks(code text, name text, price real)'
c.execute(create_sql)
s_code, s_name, s_price = '601998', '中国银行', 3.19
insert_sql = "insert into stocks values(?,?,?)"
c.execute(insert_sql, (s_code, s_name, s_price))
conn.commit()

result = c.execute("SELECT * FROM stocks where code=:1 and name=:2", {"1":s_code, "2": s_name})
for row in result:
    print(row)
c.close()
conn.close()